package com.csu.cphone.enums;

public enum OrderStatus
{

    OTHER_ORDER("其他订单", 0), MAINTAIN_ORDER("维修订单", 1), RECYCLE_ORDER("回收订单", 2), EXCHANGE_ORDER("兑换订单", 3);

    private String text;
    private Integer value;

    private OrderStatus(String text, Integer value)
    {
        this.text = text;
        this.value = value;
    }

    public String getText()
    {
        return text;
    }

    public Integer getValue()
    {
        return value;
    }

    public static OrderStatus getByValue(Integer value)
    {
        for (OrderStatus order : values())
        {
            if (order.getValue().equals(value))
            {
                return order;
            }
        }
        return null;
    }
}
